package com.wisdom.springbootdemo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:第一个springboot项目
 * User: 11951
 * Date: 2025-03-01
 * Time: 16:41
 */
//1.@RequestMapping注解使用
//@RequestMapping("/user")
@RestController
public class UserController {
    @RequestMapping("/SayHi")
    public String SayHi(){
        return "Hello Spring~~";
    }
    //    我们通常向浏览器发送的都是get请求，那我们尝试一下post请求吧
    @RequestMapping("/sayhi")
    public String hello()
    {
        return "hello,springMVC~~";
    }

//    2.我们发现@RequestMapping注解支持get和post请求

    //指定GET/POST⽅法类型
    @RequestMapping(value = "/get",method = RequestMethod.POST)
    public String getRequest(){
        return "get request~~";
    }

}
